package com.crm.CLdriving.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.crm.CLdriving.po.MailPO;
import com.crm.CLdriving.service.MailService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 发送邮件
 * @author Administrator
 *
 */
@Api(tags = "邮件")
@Controller
@RequestMapping("/mail")
public class MailController {
	
	@Autowired
	private MailService mailService;
	
	@RequestMapping(value = "/sendMail", method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("邮件发送接口")
	public MailPO sendMail(@ModelAttribute MailPO mailPO,@ModelAttribute MultipartFile[] files) {
		 mailPO.setMultipartFiles(files);
	     return mailService.sendMail(mailPO);
	}

}
